package com.leoman.indexapi.service;

import com.leoman.adsindex.entity.vo.AdsIndexVo;
import com.leoman.barrage.entity.Barrage;
import com.leoman.exception.CommentNotFindException;
import com.leoman.exception.ParamsErrorException;
import com.leoman.exception.UserSpeakErrorException;
import com.leoman.exception.WorkNotFindException;
import com.leoman.message.entity.vo.MessageVo;
import com.leoman.post.entity.vo.PostImageVo;
import com.leoman.work.entity.Work;
import com.leoman.work.entity.vo.WorkComicVo;
import com.leoman.work.entity.vo.WorkCommentVo;
import com.leoman.work.entity.vo.WorkNovelVo;
import com.leoman.work.entity.vo.WorkVideoVo;
import org.springframework.data.domain.Page;

import java.util.List;

/**
 * 作品接口
 * Created by tutu on 2016/6/12.
 */
public interface WorkApiService {

    // 查询首页作品集列表
    List<Work> iFindList(String time) throws ParamsErrorException;

    // 查询首页推荐列表
    List<AdsIndexVo> iFindList();

    // 查询视频列表（分页）
    Page<WorkVideoVo> videoPage(Long userId, Integer pageNum, Integer pageSize);

    // 查询视频列表（分页）
    Page<WorkVideoVo> videoPage(Integer pageNum, Integer pageSize);

    // 查询漫画列表（分页）
    Page<WorkComicVo> comicPage(Long userId, Integer pageNum, Integer pageSize);

    // 查询漫画列表（分页）
    Page<WorkComicVo> comicPage(Integer pageNum, Integer pageSize);

    // 查询小说列表（分页）
    Page<WorkNovelVo> novelPage(Long userId, Integer pageNum, Integer pageSize);

    // 查询小说列表（分页）
    Page<WorkNovelVo> novelPage2(Integer pageNum, Integer pageSize);

    // 查询视频详情
    WorkVideoVo findVideo(Long workId, Long userId) throws ParamsErrorException, WorkNotFindException;

    // 查询漫画详情
    WorkComicVo findComic(Long workId, Long userId) throws ParamsErrorException, WorkNotFindException;

    // 查询小说详情
    WorkNovelVo findNovel(Long workId, Long userId) throws ParamsErrorException, WorkNotFindException;

    // 查询小说详情
    String findNovelContent(Long workNovelId) throws ParamsErrorException, WorkNotFindException;

    // 查询漫画详情
    List<PostImageVo> findComicContent(Long workComicId) throws ParamsErrorException, WorkNotFindException;

    // 查询评论列表
    Page<WorkCommentVo> iPageByParams(Long workId, Integer type, Integer status, Long userId, Integer pageNum, Integer pageSize);

    // 发表作品评论
    void saveWorkComment(Integer status, Long workId, Integer type, Long userId, String content) throws ParamsErrorException, UserSpeakErrorException, WorkNotFindException;

    // 回复作品评论
    void saveWorkReply(Integer status, Long workCommentId, Long userId, String content) throws ParamsErrorException, UserSpeakErrorException, CommentNotFindException;

    // 弹幕列表
    List<Barrage> iFindBarrageList(Long workId, Integer type, Integer timePlus) throws ParamsErrorException, WorkNotFindException;

    // 发送弹幕
    void insertBarrage(Integer type, Long workId, Long userId, Integer time, Integer timePlus, String content) throws ParamsErrorException, UserSpeakErrorException;

    Page<MessageVo> pageMessage(Long userId, Integer type, Integer pageNum, Integer pageSize);

    // 弹幕列表（xml）
    String iFindBarrageListXml(Long workId, Integer type, Integer timePlus) throws ParamsErrorException, WorkNotFindException;

    // 统计作品详情浏览量
    void saveDetailData(Integer type, Long detailId) throws ParamsErrorException;
}
